package pojo;


import java.time.LocalDate;
import java.util.Objects;

public class Car{
    private String carNum;
    private double disPlacement;
    //发布时间
    private LocalDate releaseTime;
    private double price;
    private double mileage;
    private String clutchType;
    //上牌时间
    private LocalDate licensingTime;
    private Brand brand;
    private CarType carType;

    public Car() {
    }
    public Car(String carNum, double disPlacement, LocalDate releaseTime, double price, double mileage, String clutchType, LocalDate licensingTime, Brand brand, CarType carType) {
        this.carNum = carNum;
        this.disPlacement = disPlacement;
        this.releaseTime = releaseTime;
        this.price = price;
        this.mileage = mileage;
        this.clutchType = clutchType;
        this.licensingTime = licensingTime;
        this.brand = brand;
        this.carType = carType;
    }

    public String getCarNum() {
        return carNum;
    }

    public void setCarNum(String carNum) {
        this.carNum = carNum;
    }

    public double getDisPlacement() {
        return disPlacement;
    }

    public void setDisPlacement(double disPlacement) {
        this.disPlacement = disPlacement;
    }

    public LocalDate getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(LocalDate releaseTime) {
        this.releaseTime = releaseTime;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getMileage() {
        return mileage;
    }

    public void setMileage(double mileage) {
        this.mileage = mileage;
    }

    public String getClutchType() {
        return clutchType;
    }

    public void setClutchType(String clutchType) {
        this.clutchType = clutchType;
    }

    public LocalDate getLicensingTime() {
        return licensingTime;
    }

    public void setLicensingTime(LocalDate licensingTime) {
        this.licensingTime = licensingTime;
    }

    public pojo.Brand getBrand() {
        return brand;
    }

    public void setBrand(pojo.Brand brand) {
        this.brand = brand;
    }

    public pojo.CarType getCarType() {
        return carType;
    }

    public void setCarType(pojo.CarType carType) {
        this.carType = carType;
    }

    @Override
    public String toString() {
        return "Car{" +
                "carNum='" + carNum + '\'' +
                ", disPlacement=" + disPlacement +
                ", releaseTime=" + releaseTime +
                ", price=" + price +
                ", mileage=" + mileage +
                ", clutchType='" + clutchType + '\'' +
                ", licensingTime=" + licensingTime +
                ", brand=" + brand +
                ", carType=" + carType +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Car car = (Car) o;
        return Double.compare(car.disPlacement, disPlacement) == 0 &&
                Double.compare(car.price, price) == 0 &&
                Double.compare(car.mileage, mileage) == 0 &&
                Objects.equals(carNum, car.carNum) &&
                Objects.equals(releaseTime, car.releaseTime) &&
                Objects.equals(clutchType, car.clutchType) &&
                Objects.equals(licensingTime, car.licensingTime) &&
                Objects.equals(brand, car.brand) &&
                Objects.equals(carType, car.carType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(carNum, disPlacement, releaseTime, price, mileage, clutchType, licensingTime, brand, carType);
    }
}
